document.addEventListener("DOMContentLoaded", function() {
    const adContainer = document.getElementById("adContainer");
    const adImage = document.getElementById("adImage");
    const hideAdBtn = document.getElementById("hideAdBtn");

    // 显示广告
    setTimeout(() => {
        adContainer.style.height = "400px";
    }, 1000); // 延迟1秒后开始显示广告

    // 5秒后隐藏广告
    setTimeout(() => {
        adContainer.style.height = "0";
    }, 6000); // 5秒后隐藏广告

    // 点击按钮隐藏广告
    hideAdBtn.addEventListener("click", function() {
        adContainer.style.height = "0";
    });
});